
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

    <title>AVH &#8212; LAVA 2024.05 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/sphinx_highlight.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="LAVA Software Community Project Code of Conduct" href="code-of-conduct.html" />
    <link rel="prev" title="FVP" href="fvp.html" />
    <link rel="canonical" href="https://docs.lavasoftware.org/lava/avh.html" />
  
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.4.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>


  </head><body>

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html"><span><img src="_static/lava.png"></span>
          LAVA</a>
        <span class="navbar-text navbar-version pull-left"><b>2024.05</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
                <li><a href="genindex.html">Index</a></li>
                <li><a href="contents.html">Contents</a></li>
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Introduction to LAVA</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="contents.html">Contents</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary of terms</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="support.html">Getting support</a></li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">AVH</a><ul>
<li><a class="reference internal" href="#lava-avh-dispatcher-setup">LAVA AVH Dispatcher Setup</a></li>
<li><a class="reference internal" href="#api-authentication">API Authentication</a></li>
<li><a class="reference internal" href="#limitation">Limitation</a></li>
<li><a class="reference internal" href="#job-example">Job Example</a></li>
</ul>
</li>
</ul>
</ul>
</li>
              
            
            
              
                
  <li>
    <a href="fvp.html" title="Previous Chapter: FVP"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; FVP</span>
    </a>
  </li>
  <li>
    <a href="code-of-conduct.html" title="Next Chapter: LAVA Software Community Project Code of Conduct"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">LAVA Software... &raquo;</span>
    </a>
  </li>
              
            
            
            
            
              <li class="hidden-sm"></li>
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="body col-md-12 content" role="main">
      
  <section id="avh">
<span id="index-0"></span><h1>AVH<a class="headerlink" href="#avh" title="Permalink to this heading">¶</a></h1>
<p>The AVH device type in LAVA refers to <a class="reference external" href="https://www.arm.com/products/development-tools/simulation/virtual-hardware">Arm Virtual Hardware</a>.</p>
<p>AVH for third-party boards provides cloud-based functionally accurate virtual
models of popular IoT development kits, simulating CPU, peripherals, sensors
and board components. It allows developers to execute the same binaries as on
the real hardware and so leverage the board SDKs and software code examples.</p>
<p>AVH integration in LAVA enables efficient CI workflow for modern agile software
development.</p>
<section id="lava-avh-dispatcher-setup">
<h2>LAVA AVH Dispatcher Setup<a class="headerlink" href="#lava-avh-dispatcher-setup" title="Permalink to this heading">¶</a></h2>
<p>LAVA uses <a class="reference external" href="https://pypi.org/project/avh-api/">avh-api</a> Python library to
communicate with AVH’s REST API for managing virtual devices. If you are a LAVA
docker worker user, the library is already pre-installed in lava dispatcher
docker image. If your LAVA dispatcher is installed via APT, you will need to
install the avh-api library manually using the following commands. This is
mainly because the library isn’t available via APT installation yet.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>apt-get<span class="w"> </span>install<span class="w"> </span>--no-install-recommends<span class="w"> </span>--yes<span class="w"> </span>python3-pip
python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>avh-api<span class="o">==</span><span class="m">1</span>.0.5
</pre></div>
</div>
</section>
<section id="api-authentication">
<h2>API Authentication<a class="headerlink" href="#api-authentication" title="Permalink to this heading">¶</a></h2>
<p>The following steps are required to authorize LAVA for API access to AVH.</p>
<ol class="arabic">
<li><p>Generate AVH API token.</p>
<p>Log in to AVH with your Arm account at <a class="reference external" href="https://app.avh.arm.com">https://app.avh.arm.com</a>. Navigate to
your profile by clicking on your name at the top right corner. Change to API
tab. Then click GENERATE button to generate your AVH API Token.</p>
</li>
<li><p>Add LAVA remote artifact tokens.</p>
<p>Log in to LAVA server. Click on your name at the top right corner, and then
click Profile. On the profile page, click the Remote artifact tokens Create
button and input <code class="docutils literal notranslate"><span class="pre">avh_api_token</span></code> for Token name and the above AVH API
token for Token string. Save the token.</p>
</li>
<li><p>Define secrets block in LAVA job definition.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">secrets</span><span class="p">:</span>
<span class="w">  </span><span class="nt">avh_api_token</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">avh_api_token</span>
</pre></div>
</div>
<p>The secrets block should include the <code class="docutils literal notranslate"><span class="pre">avh_api_token</span></code> key. LAVA dispatcher
needs it for AVH API authentication. The key value should be the <strong>name</strong> of
the above LAVA remote artifact token name. At run time, the token name will
be replaced with the token string by LAVA server. This is mainly for hiding
the real token in a public LAVA job.</p>
</li>
</ol>
</section>
<section id="limitation">
<h2>Limitation<a class="headerlink" href="#limitation" title="Permalink to this heading">¶</a></h2>
<p>Concurrent uploads of AVH firmware images could be only 5 at a time. The
limitation is per AVH project. After 5 images uploaded to the same project,
when another one is uploaded it overrides the first. Trying to run more than 5
AVH LAVA jobs using the same AVH project may hit instance creating error as the
image uploaded could be overridden by another one at any time.</p>
<p>Multiple projects are possible but only in enterprise/domain accounts so far.
For these accounts, lab admin could extend the base AVH device type by setting
the <code class="docutils literal notranslate"><span class="pre">avh_project_name</span></code> variable to a different AVH project name to create
another device type. The variable defaults to <code class="docutils literal notranslate"><span class="pre">Default</span> <span class="pre">Project</span></code>. The number
of devices for these device types should be always equal to or less than 5.</p>
<p>LAVA users also could overwrite the AVH project name in the device dictionary
or in job definition using the <code class="docutils literal notranslate"><span class="pre">deploy.options.project_name</span></code> key.</p>
</section>
<section id="job-example">
<h2>Job Example<a class="headerlink" href="#job-example" title="Permalink to this heading">¶</a></h2>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">device_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">avh</span>
<span class="nt">job_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">avh-rpi4b-health-check</span>

<span class="nt">timeouts</span><span class="p">:</span>
<span class="w">  </span><span class="nt">job</span><span class="p">:</span>
<span class="w">    </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">60</span>

<span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">medium</span>
<span class="nt">visibility</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">public</span>

<span class="nt">secrets</span><span class="p">:</span>
<span class="w">  </span><span class="nt">avh_api_token</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">avh_api_token</span>

<span class="nt">actions</span><span class="p">:</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">deploy</span><span class="p">:</span>
<span class="w">    </span><span class="nt">to</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">avh</span>
<span class="w">    </span><span class="nt">options</span><span class="p">:</span>
<span class="w">      </span><span class="nt">model</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">rpi4b</span>
<span class="w">    </span><span class="nt">timeout</span><span class="p">:</span>
<span class="w">      </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">30</span>
<span class="w">    </span><span class="nt">images</span><span class="p">:</span>
<span class="w">      </span><span class="nt">rootfs</span><span class="p">:</span>
<span class="w">        </span><span class="nt">url</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://example.com/rpi4b/nand</span>
<span class="w">        </span><span class="nt">format</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ext4</span>
<span class="w">        </span><span class="nt">root_partition</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1</span>
<span class="w">      </span><span class="nt">kernel</span><span class="p">:</span>
<span class="w">        </span><span class="nt">url</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://example.com/rpi4b/kernel</span>
<span class="w">      </span><span class="nt">dtb</span><span class="p">:</span>
<span class="w">        </span><span class="nt">url</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://example.com/rpi4b/devicetree</span>

<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">boot</span><span class="p">:</span>
<span class="w">    </span><span class="nt">method</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">avh</span>
<span class="w">    </span><span class="nt">timeout</span><span class="p">:</span>
<span class="w">      </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">20</span>
<span class="w">    </span><span class="nt">prompts</span><span class="p">:</span>
<span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&quot;pi@raspberrypi:&quot;</span>
<span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&quot;root@raspberrypi:&quot;</span>
<span class="w">    </span><span class="nt">auto_login</span><span class="p">:</span>
<span class="w">      </span><span class="nt">login_prompt</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;login:&quot;</span>
<span class="w">      </span><span class="nt">username</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pi</span>
<span class="w">      </span><span class="nt">password_prompt</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Password:&#39;</span>
<span class="w">      </span><span class="nt">password</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">raspberry</span>
<span class="w">      </span><span class="nt">login_commands</span><span class="p">:</span>
<span class="w">      </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sudo su</span>

<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">test</span><span class="p">:</span>
<span class="w">    </span><span class="nt">timeout</span><span class="p">:</span>
<span class="w">      </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">10</span>
<span class="w">    </span><span class="nt">definitions</span><span class="p">:</span>
<span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">inline</span>
<span class="w">      </span><span class="nt">repository</span><span class="p">:</span>
<span class="w">        </span><span class="nt">metadata</span><span class="p">:</span>
<span class="w">          </span><span class="nt">format</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Lava-Test Test Definition 1.0</span>
<span class="w">          </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">health checks</span>
<span class="w">        </span><span class="nt">run</span><span class="p">:</span>
<span class="w">          </span><span class="nt">steps</span><span class="p">:</span>
<span class="w">          </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-case kernel-info --shell uname -a</span>
<span class="w">          </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-case network-info --shell ip a</span>
<span class="w">      </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">health-checks</span>
<span class="w">      </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">inline/health-checks.yaml</span>
</pre></div>
</div>
</section>
</section>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
    </p>
    <p>
        &copy; Copyright 2010-2019, Linaro Limited.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.3.0.<br/>
    </p>
  </div>
</footer>
  </body>
</html>